/**
 *	4.下面的循环用于测试某个字符串是否回文，请对它进行重写，用指针变量代替下标。
 *	char buffer[SIZE];
 *	int front,rear;
 *	...
 *	front = 0;
 *	rear = strlen(buffer) - 1;
 *	while(front < rear){
 *		if(buffer[front] != buffer[rear])
 *			break;
 *		front += 1;
 *		rear -= 1;
 *	}
 *	if(front >= rear){
 *		printf("It is a palindrome\n");
 *	}
**/
#include <stdio.h>
#include <string.h>

#define SIZE 1024

int main()
{
	char buffer[SIZE];
	char *front, *rear;

	printf("请输入要判断的字符串：");
	scanf("%s", buffer);	

	front = buffer;
	rear = buffer + strlen(buffer) - 1;
	
	while(front <rear)
	{
		if(*front != *rear)
			break;
		front++;
		rear--;
	}
	
	if(front >= rear)
		printf("It is a palindrome\n");
	else 
		printf("It is not a pralindrome\n");	

	return 0;
}

